

class ComplexField:

	
	# Returns the value of the primary sub-field for this complex field.
	# This is usually the "value" sub-field, and it's the value used for sorting/filtering.
	
	def getPrimarySubValue(self):
		from lib import Util;
		Util.abstract();



class Account(ComplexField):
	
	def __init__(self, domain, userid, username, primary = None):
	
		self.__domain_ = domain;
		self.__userid_ = userid;
		self.__username_ = username;
		self.__primary_ = primary;
	

	def getDomain(self):
	
		return self.__domain_;
	

	def setDomain(self, domain):
	
		self.__domain_ = domain;
	

	def getUserid(self):
	
		return self.__userid_;
	

	def setUserid(self, userid):
	
		self.__userid_ = userid;
	

	def getUsername(self):
	
		return self.__username_;
	

	def setUsername(self, username):
	
		self.__username_ = username;
	

	def getPrimary(self):
	
		return self.__primary_;
	

	def setPrimary(self, primary):
	
		self.__primary_ = primary;
	

	def getPrimarySubValue(self):
	
		return self.getDomain();
	




 # see
 # http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Activity
 
class Activity:
	def __init__(self, id, userId):
		self.appId = '';
		self.body = '';
		self.bodyId = '';
		self.externalId = '';
		self.mediaItems = '';
		self.postedTime = '';
		self.priority = '';
		self.streamFaviconUrl = '';
		self.streamSourceUrl = '';
		self.streamTitle = '';
		self.streamUrl = '';
		self.templateParams = '';
		self.title = '';
		self.titleId = '';
		self.url = '';
	
		self.id = id;
		self.userId = userId;
	

	def getAppId(self):
	
		return self.appId;
	

	def setAppId(self, appId):
	
		self.appId = appId;
	

	def getBody(self):
	
		return self.body;
	

	def setBody(self, body):
	
		self.body = body;
	

	def getBodyId(self):
	
		return self.bodyId;
	

	def setBodyId(self, bodyId):
	
		self.bodyId = bodyId;
	

	def getExternalId(self):
	
		return self.externalId;
	

	def setExternalId(self, externalId):
	
		self.externalId = externalId;
	

	def getId(self):
	
		return self.id;
	

	def setId(self, id):
	
		self.id = id;
	

	def getMediaItems(self):
	
		return self.mediaItems;
	

	def setMediaItems(self, mediaItems):
	
		self.mediaItems = mediaItems;
	

	def getPostedTime(self):
	
		return self.postedTime;
	

	def setPostedTime(self, postedTime):
	
		self.postedTime = postedTime;
	

	def getPriority(self):
	
		return self.priority;
	

	def setPriority(self, priority):
	
		self.priority = priority;
	

	def getStreamFaviconUrl(self):
	
		return self.streamFaviconUrl;
	

	def setStreamFaviconUrl(self, streamFaviconUrl):
	
		self.streamFaviconUrl = streamFaviconUrl;
	

	def getStreamSourceUrl(self):
	
		return self.streamSourceUrl;
	

	def setStreamSourceUrl(self, streamSourceUrl):
	
		self.streamSourceUrl = streamSourceUrl;
	

	def getStreamTitle(self):
	
		return self.streamTitle;
	

	def setStreamTitle(self, streamTitle):
	
		self.streamTitle = streamTitle;
	

	def getStreamUrl(self):
	
		return self.streamUrl;
	

	def setStreamUrl(self, streamUrl):
	
		self.streamUrl = streamUrl;
	

	def getTemplateParams(self):
	
		return self.templateParams;
	

	def setTemplateParams(self, templateParams):
	
		self.templateParams = templateParams;
	

	def getTitle(self):
	
		return self.title;
	

	def setTitle(self, title):
	
		self.title = title;
	

	def getTitleId(self):
	
		return self.titleId;
	

	def setTitleId(self, titleId):
	
		self.titleId = titleId;
	

	def getUrl(self):
	
		return self.url;
	

	def setUrl(self, url):
	
		self.url = url;
	

	def getUserId(self):
	
		return self.userId;
	

	def setUserId(self, userId):
	
		self.userId = userId;
	


# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Address

class Address(ComplexField):
	

	def __init__(self, formatted, primary = None):
		self.country = '';
		self.latitude = '';
		self.longitude = '';
		self.locality = '';
		self.postalCode = '';
		self.region = '';
		self.streetAddress = '';
		self.type = '';
	
		self.formatted = formatted;
		self.primary = primary;
	

	def getCountry(self):
	
		return self.country;
	

	def setCountry(self, country):
	
		self.country = country;
	

	def getLatitude(self):
	
		return self.latitude;
	

	def setLatitude(self, latitude):
	
		self.latitude = latitude;
	

	def getLocality(self):
	
		return self.locality;
	

	def setLocality(self, locality):
	
		self.locality = locality;
	

	def getLongitude(self):
	
		return self.longitude;
	

	def setLongitude(self, longitude):
	
		self.longitude = longitude;
	

	def getPostalCode(self):
	
		return self.postalCode;
	

	def setPostalCode(self, postalCode):
	
		self.postalCode = postalCode;
	

	def getRegion(self):
	
		return self.region;
	

	def setRegion(self, region):
	
		self.region = region;
	

	def getStreetAddress(self):
	
		return self.streetAddress;
	

	def setStreetAddress(self, streetAddress):
	
		self.streetAddress = streetAddress;
	

	def getType(self):
	
		return self.type;
	

	def setType(self, type):
	
		self.type = type;
	

	def getFormatted(self):
	
		return self.formatted;
	

	def setFormatted(self, formatted):
	
		self.formatted = formatted;
	

	def getPrimary(self):
	
		return self.primary;
	

	def setPrimary(self, primary):
	
		self.primary = primary;
	

	def getPrimarySubValue(self):
	
		return self.getFormatted();
	

# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Collection

class ApiCollection:

	def __init__(self, items, offset = False, totalSize = False):
	
		self.items = items;
		self.offset = offset;
		self.totalSize = totalSize;
	

	def getItems(self):
	
		return self.items;
	

	def setItems(self, items):
	
		self.items = items;
	

	def getOffset(self):
	
		return self.offset;
	

	def setOffset(self, offset):
	
		self.offset = offset;
	

	def getTotalSize(self):
	
		return self.totalSize;
	

	def setTotalSize(self, totalSize):
	
		self.totalSize = totalSize;
	

# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.BodyType

class BodyType(ComplexField):
	def __init__(self):
		self.build = '';
		self.eyeColor = '';
		self.hairColor = '';
		self.height = '';
		self.weight = '';

	def getBuild(self):
	
		return self.build;
	

	def setBuild(self, build):
	
		self.build = build;
	

	def getEyeColor(self):
	
		return self.eyeColor;
	

	def setEyeColor(self, eyeColor):
	
		self.eyeColor = eyeColor;
	

	def getHairColor(self):
	
		return self.hairColor;
	

	def setHairColor(self, hairColor):
	
		self.hairColor = hairColor;
	

	def getHeight(self):
	
		return self.height;
	

	def setHeight(self, height):
	
		self.height = height;
	

	def getWeight(self):
	
		return self.weight;
	

	def setWeight(self, weight):
	
		self.weight = weight;
	

	def getPrimarySubValue(self):
	
		# FIXME: is primary sub-field specified for bodyType in the spec??
		return self.getBuild(); 
	


#Base class for plural fields, defining the standard value/type/primary sub-fields.
 
class ListField(ComplexField):
	def __init__(self, value, type, primary = None):
	
		self.value = value;
		self.type = type;
		self.primary = primary;
	

	def getValue(self):
	
		return self.value;
	

	def setValue(self, value):
	
		self.value = value;
	

	def getType(self):
	
		return self.type;
	

	def setType(self, type):
	
		self.type = type;
	

	def getPrimary(self):
	
		return self.primary;
	

	def setPrimary(self, primary):
	
		self.primary = True if(primary) else None;
	

	def getPrimarySubValue(self):
	
		return self.getValue();
	


# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Email

class Email(ListField):
	pass;


# 
# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Enum
# Base class for all Enum objects. This class allows containers to use constants
# for fields that have a common set of values.
# 

class Enum(ComplexField):

	def __init__(self, key, displayValue = ''):
		self.values = {};

		#[todo]
		if (len(key) > 0 and not self.values.has_key(key)):
			if (key in self.values):
				# case of mixing key <> display value, correct it
				key = array_search(key, self.values);
			else:
				raise  Exception, "Invalid Enum key: key";
			
		
		self.key = key;
		
		if(len(displayValue) > 0):
			self.displayValue = displayValue ;
		elif(self.values.has_key(key)):
			self.displayValue = self.values[key]
		else:
			self.displayValue = '';

		self.values = None;
	

	def getDisplayValue(self):	
		return self.displayValue;	

	def setDisplayValue(self, displayValue):	
		self.displayValue = displayValue;
	

	def toString(self):	
		return self.jsonString;
	

	def getPrimarySubValue(self): 
		return self.key;


# 
# public Enum for opensocial.Enum.Drinker
# 
class EnumDrinker(Enum):
	def __init(self):
		self.values = {'HEAVILY' : "Heavily", 'NO' : "No", 'OCCASIONALLY' : "Occasionally", 
				'QUIT' : "Quit", 'QUITTING' : "Quitting", 'REGULARLY' : "Regularly", 
				'SOCIALLY' : "Socially", 'YES' : "Yes"};


# 
# public Enum for opensocial.Enum.Gender
# 
class EnumGender(Enum):
	def __init(self):
		self.values = {'FEMALE' : "Female", 'MALE' : "Male"};


# 
# public Enum for opensocial.Enum.LookingFor
# 
class EnumLookingFor(Enum):
	def __init(self):
		self.values = {'ACTIVITY_PARTNERS' : 'Activity Partners', 'DATING' : 'Dating', 
			'FRIENDS' : 'Friends', 'NETWORKING' : 'Networking', 'RANDOM' : 'Random', 
			'RELATIONSHIP' : 'Relationship'};


# 
# public Enum for opensocial.Enum.Smoker
# 
class EnumSmoker(Enum):
	def __init(self):
		self.values = {'HEAVILY' : "Heavily", 'NO' : "No", 'OCCASIONALLY' : "Ocasionally", 
				'QUIT' : "Quit", 'QUITTING' : "Quitting", 'REGULARLY' : "Regularly", 
				'SOCIALLY' : "Socially", 'YES' : "Yes"};


# 
# public Enum for opensocial.Enum.Presence
# 
class EnumPresence(Enum):
	def __init(self):
		self.values = {'AWAY' : "Away", 'CHAT' : "Chat", 'DND' : "Do Not Disturb", 
				'OFFLINE' : "Offline", 'ONLINE' : "Online", 'XA' : "Extended Away"};




class IdSpec:
	types = ['VIEWER', 'OWNER', 'VIEWER_FRIENDS', 'OWNER_FRIENDS', 'USER_IDS'];
	
	def __init__(self, jsonSpec, type):	
		self.jsonSpec = jsonSpec;
		self.type = type;
	
	@staticmethod
	def fromJson(self, jsonIdSpec):
		if (len(jsonIdSpec) > 0 and str(jsonIdSpec) in IdSpec.types):
			idSpecEnum = str(jsonIdSpec);
		elif (len(jsonIdSpec) > 0):
			idSpecEnum = 'USER_IDS';
		else:
			raise  Exception, "The json request had a bad idSpec";
		
		return IdSpec(jsonIdSpec, idSpecEnum);
	

	# 
	# Only valid for IdSpecs of type USER_IDS
	# @return A list of the user ids in the id spec
	
	def fetchUserIds(self):
		userIdArray = self.jsonSpec;
		if (type(userIdArray).__name__ != 'list' and type(userIdArray).__name__ != 'doct'):
			userIdArray = [userIdArray];
		
		userIds = [];
		for id in userIdArray:
			userIds.append(str(id));
		
		return userIds;
	

	def getType(self):	
		return self.type;
	



# 
# see
# WRONG URL -> http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.Im.Field.html 

class Im (ListField):
	pass;

# 
# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.MediaItem

class MediaItem:
	

	def __init__(self, mimeType, type, url):
		self.types = {'AUDIO' : 'audio', 'VIDEO' : 'video', 'IMAGE' : 'image'};
		
		self.url = '';
	
		self.setMimeType(mimeType);
		self.setType(type);
		self.setUrl(url);
	

	def getMimeType(self):	
		return self.mimeType;
	

	def setMimeType(self, mimeType):
		self.mimeType = mimeType;
	

	def getType(self):	
		return self.type;
	

	def setType(self, type):	
		if (self.types[type] == None):
			raise  Exception, "Invalid Media type";
		
		self.type = self.types[type];	

	def getUrl(self):	
		return self.url;
	

	def setUrl(self, url):	
		self.url = url;
	

# Base interface for all message objects.
# 
# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Message


class Message:

	def __init__(self, initBody, initTitle, initType):
		self.body = '';
		self.title = '';
		self.type = '';
		self.types = ['EMAIL', 'NOTIFICATION', 'PRIVATE_MESSAGE','PUBLIC_MESSAGE'];
	
		self.setBody(initBody);
		self.setTitle(initTitle);
		self.setType(initType);
	

	# 
	# Gets the main text of the message.
	# @return the main text of the message
	def getBody(self):	
		return self.body;
	

	# 
	# Sets the main text of the message.
	# HTML attributes are allowed and are sanitized by the container
	# @param newBody the main text of the message
	def setBody(self, newBody):	
		self.body = newBody;
	

	# 
	# Gets the title of the message
	# @return the title of the message
	def getTitle(self):	
		return self.title;
	

	# 
	# Sets the title of the message
	# HTML attributes are allowed and are sanitized by the container.
	# @param newTitle the title of the message
	def setTitle(self, newTitle):	
		self.title = newTitle;
	

	# 
	# Gets the type of the message, as specified by opensocial.Message.Type
	# @return the type of message (enum Message.Type)

	def getType(self):	
		return self.type;
	

	# 
	# Sets the type of the message, as specified by opensocial.Message.Type
	# @param newType the type of message (enum Message.Type)

	def setType(self, newType):	
		if (not newType in self.types):
			raise  Exception, 'Invalid message type';

		self.type = newType;
	

	# 
	# TODO implement either a standard 'sanitizing' facility or
	# define an interface that can be set on this class so
	# others can plug in their own.
	# @param htmlStr String to be sanitized.
	# @return the sanitized HTML String

	def sanitizeHTML(self, htmlStr):	
		return htmlStr;


# 
# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Name
class Name(ComplexField):

	def __init__(self, formatted):
		self.additionalName;
		self.familyName;
		self.givenName;
		self.honorificPrefix;
		self.honorificSuffix;

		self.formatted = formatted;
	

	def getFormatted(self):	
		return self.formatted;
	

	def setFormatted(self, formatted):	
		self.formatted = formatted;
	

	def getAdditionalName(self):	
		return self.additionalName;
	

	def setAdditionalName(self, additionalName):	
		self.additionalName = additionalName;
	

	def getFamilyName(self):	
		return self.familyName;
	

	def setFamilyName(self, familyName):	
		self.familyName = familyName;
	

	def getGivenName(self):	
		return self.givenName;
	
	def setGivenName(self, givenName):	
		self.givenName = givenName;
	
	def getHonorificPrefix(self):	
		return self.honorificPrefix;
	

	def setHonorificPrefix(self, honorificPrefix):	
		self.honorificPrefix = honorificPrefix;
	

	def getHonorificSuffix(self):	
		return self.honorificSuffix;
	

	def setHonorificSuffix(self, honorificSuffix):	
		self.honorificSuffix = honorificSuffix;
	

	def getPrimarySubValue(self):
		return self.getFormatted();

# 
# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Organization

class Organization(ComplexField):
  def __init__(self, name, primary = None):
  	self.address;
	self.description;
	self.endDate;
	self.field;
	self.salary;
	self.startDate;
	self.subField;
	self.title;
	self.type;
	self.webpage;  

	self.name = name;
	self.primary = primary;


	def getAddress(self):	
		return self.address;

	def setAddress(self, address):
		self.address = address;
	

	def getDescription(self):
		return self.description;
	

	def setDescription(self, description):
		self.description = description;
	
	def getEndDate(self):
		return self.endDate;
	

	def setEndDate(self, endDate):
		self.endDate = endDate;
	
	def getField(self):
		return self.field;
	
	def setField(self, field):
		self.field = field;
	
	def getName(self):
		return self.name;
	
	def setName(self, name):
		self.name = name;
	
	def getSalary(self):
		return self.salary;
	
	def setSalary(self, salary):
		self.salary = salary;
	
	def getStartDate(self):
		return self.startDate;
	
	def setStartDate(self, startDate):
		self.startDate = startDate;
	
	def getSubField(self):
		return self.subField;
	
	def setSubField(self, subField):
		self.subField = subField;
	
	def getTitle(self):
		return self.title;
	
	def setTitle(self, title):
		self.title = title;
	
	def getType(self):
		return self.type;
	
	def setType(self, type):
		self.type = type;
	
	def getWebpage(self):
		return self.webpage;
	
	def setWebpage(self, webpage):
		self.webpage = webpage;
	
	def getPrimary(self):
		return self.primary;
	
	def setPrimary(self, primary):
		self.primary = primary;
	
	def getPrimarySubValue(self): 
		return self.getName();

# 
# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Person
class Person:
	
	def __init__(self, id, name):
		self.aboutMe;
		self.accounts;
		self.activities;
		self.addresses;
		self.age;
		self.birthday;
		self.bodyType;
		self.books;
		self.cars;
		self.children;
		self.currentLocation;
		self.displayName;
		self.drinker;
		self.emails;
		self.ethnicity;
		self.fashion;
		self.food;
		self.gender;
		self.happiestWhen;
		self.hasApp;
		self.heroes;
		self.humor;
		self.ims;
		self.interests;
		self.jobInterests;
		self.languagesSpoken;
		self.livingArrangement;
		self.lookingFor;
		self.movies;
		self.music;
		self.organizations;
		self.networkPresence;
		self.nickname;
		self.pets;
		self.phoneNumbers;
		self.photos;
		self.politicalViews;
		self.profileSong;
		self.profileUrl;
		self.profileVideo;
		self.quotes;
		self.relationshipStatus;
		self.religion;
		self.romance;
		self.scaredOf;
		self.sexualOrientation;
		self.smoker;
		self.sports;
		self.status;
		self.tags;
		self.thumbnailUrl;
		self.utcOffset;
		self.turnOffs;
		self.turnOns;
		self.tvShows;
		self.urls;

		# Note: Not in the opensocial js person object directly
		self.isOwner = false;
		self.isViewer = false;
	
		self.id = id;
		self.name = name;
	

	def __setFieldImpl_(self, fieldName, value):
		# treat empty singular/plural fields as None so they don't pollute the output
		if (value == '' or ( (type(value).__name__ == 'list' or type(value).__name__ == 'dict') and len(value) == 0)):
			value = None;

		self.fieldName = value;

	#  
	# Returns the field value for the given fieldName, if present.
	# @param fieldName name of the contact field, e.g. "displayName"

	def getFieldByName(self, fieldName):
		if (self.fieldName != None):
			return self.fieldName;
		
		return None;
	

	def getAboutMe(self):
		return self.aboutMe;
	
	def setAboutMe(self, aboutMe):
		self.setFieldImpl('aboutMe', aboutMe);
	
	def getAccounts(self):
		return self.accounts;
	
	def setAccounts(self, accounts):
		self.setFieldImpl('accounts', accounts);
	
	def getActivities(self):
		return self.activities;
	
	def setActivities(self, activities):
		self.setFieldImpl('activities', activities);
	
	def getAddresses(self):
		return self.addresses;
	
	def setAddresses(self, addresses):
		self.setFieldImpl('addresses', addresses);
	
	def getAge(self):
		return self.age;
	
	def setAge(self, age):
		self.setFieldImpl('age', age);
	
	def getBirthday(self):
		return self.birthday;
	
	def setBirthday(self, birthday):
		# TODO: enforce YYYY-MM-DD format here?
		self.setFieldImpl('birthday', birthday);
	
	def getBodyType(self):
		return self.bodyType;
	
	def setBodyType(self, bodyType):
		self.setFieldImpl('bodyType', bodyType);
	
	def getBooks(self):
		return self.books;
	
	def setBooks(self, books):
		self.setFieldImpl('books', books);
	
	def getCars(self):
		return self.cars;
	
	def setCars(self, cars):
		self.setFieldImpl('cars', cars);
	
	def getChildren(self):
		return self.children;
	

	def setChildren(self, children):
		self.setFieldImpl('children', children);
	
	def getCurrentLocation(self):
		return self.currentLocation;
	
	def setCurrentLocation(self, currentLocation):
		self.setFieldImpl('currentLocation', currentLocation);
	
	def getDisplayName(self):
		return self.displayName;
	
	def setDisplayName(self, displayName):
		self.setFieldImpl('displayName', displayName);
	
	def getDrinker(self):
		return self.drinker;
	
	def setDrinker(self, drinker):
		self.setFieldImpl('drinker', EnumDrinker(drinker));
	
	def getEmails(self):
		return self.emails;
	
	def setEmails(self, emails):
		self.setFieldImpl('emails', emails);
	
	def getEthnicity(self):
		return self.ethnicity;
	
	def setEthnicity(self, ethnicity):
		self.setFieldImpl('ethnicity', ethnicity);
	
	def getFashion(self):
		return self.fashion;
	
	def setFashion(self, fashion):
		self.setFieldImpl('fashion', fashion);
	
	def getFood(self):
		return self.food;
	
	def setFood(self, food):
		self.setFieldImpl('food', food);
	
	def getGender(self):
		return self.gender;
	
	def setGender(self, gender):
		self.setFieldImpl('gender', gender);
	
	def getHappiestWhen(self):
		return self.happiestWhen;
	
	def setHappiestWhen(self, happiestWhen):
		self.setFieldImpl('happiestWhen', happiestWhen);
	
	def getHeroes(self):
		return self.heroes;
	
	def setHeroes(self, heroes):
		self.setFieldImpl('heroes', heroes);
	

	def getHasApp(self):
	
		return self.hasApp;
	

	def setHasApp(self, hasApp):
	
		self.setFieldImpl('hasApp', hasApp);
	

	def getHumor(self):
	
		return self.humor;
	

	def setHumor(self, humor):
	
		self.setFieldImpl('humor', humor);
	

	def getId(self):
	
		return self.id;
	

	def setId(self, id):
	
		self.setFieldImpl('id', id);
	

	def getIms(self):
	
		return self.ims;
	

	def setIms(self, ims):
	
		self.setFieldImpl('ims', ims);
	

	def getInterests(self):
	
		return self.interests;
	

	def setInterests(self, interests):
	
		self.setFieldImpl('interests', interests);
	

	def getJobInterests(self):
	
		return self.jobInterests;
	

	def setJobInterests(self, jobInterests):
	
		self.setFieldImpl('jobInterests', jobInterests);
	

	def getLanguagesSpoken(self):
	
		return self.languagesSpoken;
	

	def setLanguagesSpoken(self, languagesSpoken):
	
		self.setFieldImpl('languagesSpoken', languagesSpoken);
	

	def getLivingArrangement(self):
	
		return self.livingArrangement;
	

	def setLivingArrangement(self, livingArrangement):
	
		self.setFieldImpl('livingArrangement', livingArrangement);
	

	def getLookingFor(self):
	
		return self.lookingFor;
	

	def setLookingFor(self, lookingFor):
	
		self.setFieldImpl('lookingFor', EnumLookingFor(lookingFor));
	

	def getMovies(self):
	
		return self.movies;
	

	def setMovies(self, movies):
	
		self.setFieldImpl('movies', movies);
	

	def getMusic(self):
	
		return self.music;
	

	def setMusic(self, music):
	
		self.setFieldImpl('music', music);
	

	def getName(self):
	
		return self.name;
	

	def setName(self, name):
	
		self.setFieldImpl('name', name);
	

	def getNetworkPresence(self):
	
		return self.networkPresence;
	

	def setNetworkPresence(self, networkPresence):
	
		self.setFieldImpl('networkPresence', EnumPresence(networkPresence));
	

	def getNickname(self):
	
		return self.nickname;
	

	def setNickname(self, nickname):
	
		self.nickname = nickname;
		self.setFieldImpl('nickname', nickname);
	

	def getOrganizations(self):
	
		return self.organizations;
	

	def setOrganizations(self, organizations):
	
		self.setFieldImpl('organizations', organizations);
	

	def getPets(self):
	
		return self.pets;
	

	def setPets(self, pets):
	
		self.setFieldImpl('pets', pets);
	

	def getPhoneNumbers(self):
	
		return self.phoneNumbers;
	

	def setPhoneNumbers(self, phoneNumbers):
	
		self.setFieldImpl('phoneNumbers', phoneNumbers);
	

	def getPhotos(self):
	
		return self.photos;
	

	def setPhotos(self, photos):
	
		self.setFieldImpl('photos', photos);
	

	def getPoliticalViews(self):
	
		return self.politicalViews;
	

	def setPoliticalViews(self, politicalViews):
	
		self.setFieldImpl('politicalViews', politicalViews);
	

	def getProfileSong(self):
	
		return self.profileSong;
	

	def setProfileSong(self, profileSong):
	
		self.setFieldImpl('profileSong', profileSong);
	

	def getProfileUrl(self):
	
		return self.profileUrl;
	

	def setProfileUrl(self, profileUrl):
	
		self.setFieldImpl('profileUrl', profileUrl);
	

	def getProfileVideo(self):
	
		return self.profileVideo;
	

	def setProfileVideo(self, profileVideo):
	
		self.setFieldImpl('profileVideo', profileVideo);
	

	def getQuotes(self):
	
		return self.quotes;
	

	def setQuotes(self, quotes):
	
		self.setFieldImpl('quotes', quotes);
	

	def getRelationshipStatus(self):
	
		return self.relationshipStatus;
	

	def setRelationshipStatus(self, relationshipStatus):
	
		self.setFieldImpl('relationshipStatus', relationshipStatus);
	

	def getReligion(self):
	
		return self.religion;
	

	def setReligion(self, religion):
	
		self.religion = religion;
	

	def getRomance(self):
	
		return self.romance;
	

	def setRomance(self, romance):
	
		self.setFieldImpl('romance', romance);
	

	def getScaredOf(self):
	
		return self.scaredOf;
	

	def setScaredOf(self, scaredOf):
	
		self.setFieldImpl('scaredOf', scaredOf);
	

	def getSexualOrientation(self):
	
		return self.sexualOrientation;
	

	def setSexualOrientation(self, sexualOrientation):
	
		self.setFieldImpl('sexualOrientation', sexualOrientation);
	

	def getSmoker(self):
	
		return self.smoker;
	

	def setSmoker(self, smoker):
	
		self.setFieldImpl('smoker', EnumSmoker(smoker));
	

	def getSports(self):
	
		return self.sports;
	

	def setSports(self, sports):
	
		self.setFieldImpl('sports', sports);
	

	def getStatus(self):
	
		return self.status;
	

	def setStatus(self, status):
	
		self.setFieldImpl('status', status);
	

	def getTags(self):
	
		return self.tags;
	

	def setTags(self, tags):
	
		self.setFieldImpl('tags', tags);
	

	def getThumbnailUrl(self):
	
		return self.thumbnailUrl;
	

	def setThumbnailUrl(self, thumbnailUrl):
	
		self.setFieldImpl('thumbnailUrl', thumbnailUrl);
	

	def getUtcOffset(self):
	
		return self.utcOffset;
	

	def setUtcOffset(self, utcOffset):
	
		# TODO: validate +00:00 format here?
		self.setFieldImpl('utcOffset', utcOffset);
	

	def getTurnOffs(self):
	
		return self.turnOffs;
	

	def setTurnOffs(self, turnOffs):
	
		self.setFieldImpl('turnOffs', turnOffs);
	

	def getTurnOns(self):
	
		return self.turnOns;
	

	def setTurnOns(self, turnOns):
	
		self.setFieldImpl('turnOns', turnOns);
	

	def getTvShows(self):
	
		return self.tvShows;
	

	def setTvShows(self, tvShows):
	
		self.setFieldImpl('tvShows', tvShows);
	

	def getUrls(self):
	
		return self.urls;
	

	def setUrls(self, urls):
	
		self.setFieldImpl('urls', urls);
	

	def getIsOwner(self):
	
		return self.isOwner;
	

	def setIsOwner(self, isOwner):
	
		self.setFieldImpl('isOwner', isOwner);
	

	def getIsViewer(self):
	
		return self.isViewer;
	

	def setIsViewer(self, isViewer):
	
		self.setFieldImpl('isViewer', isViewer);
	




# 
# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Phone
class Phone(ListField):
	pass;


# 
# see
# http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.Photo.Field.html
class Photo (ListField):
	pass;

# 
# see
# http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Url

class Url (ListField):
	
	def __init__(self, value, type, linkText, primary = None):	
		self.value = value;
		self.type = type;
		self.linkText = linkText;
		self.primary = primary;
	

	def getLinkText(self):	
		return self.linkText;
	

	def setLinkText(self, linkText):
		self.linkText = linkText;
	

